Optimal. Leaf size=72 \[ -\frac {a^3}{2 x^2}-\frac {3 a b^2 x^{-2 (1-n)}}{2 (1-n)}-\frac {3 a^2 b x^{-2+n}}{2-n}-\frac {b^3 x^{-2+3 n}}{2-3 n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {276}
\begin {gather*} -\frac {a^3}{2 x^2}-\frac {3 a^2 b x^{n-2}}{2-n}-\frac {3 a b^2 x^{-2 (1-n)}}{2 (1-n)}-\frac {b^3 x^{3 n-2}}{2-3 n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 276
Rubi steps
\begin {align*} \int \frac {\left (a+b x^n\right )^3}{x^3} \, dx &=\int \left (\frac {a^3}{x^3}+3 a^2 b x^{-3+n}+b^3 x^{3 (-1+n)}+3 a b^2 x^{-3+2 n}\right ) \, dx\\ &=-\frac {a^3}{2 x^2}-\frac {3 a b^2 x^{-2 (1-n)}}{2 (1-n)}-\frac {3 a^2 b x^{-2+n}}{2-n}-\frac {b^3 x^{-2+3 n}}{2-3 n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 60, normalized size = 0.83 \begin {gather*} \frac {-a^3+\frac {6 a^2 b x^n}{-2+n}+\frac {3 a b^2 x^{2 n}}{-1+n}+\frac {2 b^3 x^{3 n}}{-2+3 n}}{2 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 65, normalized size = 0.90
method | result | size |
risch | \(-\frac {a^{3}}{2 x^{2}}+\frac {b^{3} x^{3 n}}{\left (-2+3 n \right ) x^{2}}+\frac {3 a \,b^{2} x^{2 n}}{2 \left (-1+n \right ) x^{2}}+\frac {3 a^{2} b \,x^{n}}{\left (-2+n \right ) x^{2}}\) | \(65\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (63) = 126\).
time = 0.38, size = 134, normalized size = 1.86 \begin {gather*} -\frac {3 \, a^{3} n^{3} - 11 \, a^{3} n^{2} + 12 \, a^{3} n - 4 \, a^{3} - 2 \, {\left (b^{3} n^{2} - 3 \, b^{3} n + 2 \, b^{3}\right )} x^{3 \, n} - 3 \, {\left (3 \, a b^{2} n^{2} - 8 \, a b^{2} n + 4 \, a b^{2}\right )} x^{2 \, n} - 6 \, {\left (3 \, a^{2} b n^{2} - 5 \, a^{2} b n + 2 \, a^{2} b\right )} x^{n}}{2 \, {\left (3 \, n^{3} - 11 \, n^{2} + 12 \, n - 4\right )} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 627 vs.
\(2 (58) = 116\).
time = 0.46, size = 627, normalized size = 8.71 \begin {gather*} \begin {cases} - \frac {a^{3}}{2 x^{2}} - \frac {9 a^{2} b}{4 x^{\frac {4}{3}}} - \frac {9 a b^{2}}{2 x^{\frac {2}{3}}} + b^{3} \log {\left (x \right )} & \text {for}\: n = \frac {2}{3} \\- \frac {a^{3}}{2 x^{2}} - \frac {3 a^{2} b}{x} + 3 a b^{2} \log {\left (x \right )} + b^{3} x & \text {for}\: n = 1 \\- \frac {a^{3}}{2 x^{2}} + 3 a^{2} b \log {\left (x \right )} + \frac {3 a b^{2} x^{2}}{2} + \frac {b^{3} x^{4}}{4} & \text {for}\: n = 2 \\- \frac {3 a^{3} n^{3}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {11 a^{3} n^{2}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} - \frac {12 a^{3} n}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {4 a^{3}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {18 a^{2} b n^{2} x^{n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} - \frac {30 a^{2} b n x^{n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {12 a^{2} b x^{n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {9 a b^{2} n^{2} x^{2 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} - \frac {24 a b^{2} n x^{2 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {12 a b^{2} x^{2 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {2 b^{3} n^{2} x^{3 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} - \frac {6 b^{3} n x^{3 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} + \frac {4 b^{3} x^{3 n}}{6 n^{3} x^{2} - 22 n^{2} x^{2} + 24 n x^{2} - 8 x^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.18, size = 66, normalized size = 0.92 \begin {gather*} \frac {b^3\,x^{3\,n}}{x^2\,\left (3\,n-2\right )}-\frac {a^3}{2\,x^2}+\frac {3\,a\,b^2\,x^{2\,n}}{x^2\,\left (2\,n-2\right )}+\frac {3\,a^2\,b\,x^n}{x^2\,\left (n-2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________